<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<input type="text" value="" id="time" readonly align="center">
<script>
    function f() {
    var date = new Date();
    var hours = date.getHours();
    var minutes = date.getMinutes();
    var seconds = date.getSeconds();
        document.getElementById("time").value= hours + ":" + minutes + ":" + seconds;
    // document.write(hours + ":" + minutes + ":" + seconds);
    console.log(""+hours + ":" + minutes + ":" + seconds+"");
        setTimeout(f, 1000);
    }
    setTimeout(f, 1000);
</script>
<!--<script type="text/javascript">-->
<!--    function f() {-->
<!--        document.write(Date());-->
<!--        setTimeout(f, 1000);-->
<!--    }-->
<!--    setTimeout(f, 1000);-->
<!--</script>-->


<form>

</form>
</body>
</html>